package com.dayuanit.dy17.atm.atmbackoffice.mapper;

import com.dayuanit.dy17.atm.atmbackoffice.entity.Power;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Set;

@Repository
public interface PowerMapper {
    int deleteByPrimaryKey(Long id);

    int insert(Power record);

    int insertSelective(Power record);

    Power selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(Power record);

    int updateByPrimaryKey(Power record);

    List<Power> listByLevel(Integer level);

    List<Power> listByMenu(Integer menu);

    int saveRoleRefPower(@Param("roleId") Long roleId,
                     @Param("powerIds") Set<Long> powerIds);

    List<Power> listMenuByUserId(Long userId);
}